package com.ds.robot.assistant.entity.mongo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Data
// @Document(collection = "qxUser")
public class QxUserBig {

    ////@ApiModelProperty("表Id")
    @Id
    private String id;

    //@ApiModelProperty("企信userid")
    private String userid;

    private String imei;
    //@ApiModelProperty("参数userid集合")
    @Transient
    private Set<String> userids;

    //@ApiModelProperty("企信姓名")
    private String name;
    //@ApiModelProperty("所有部门ID集合")
    private List<Integer> department;
    //@ApiModelProperty("职位")
    private String position;
    //@ApiModelProperty("电话")
    private String mobile;
    //@ApiModelProperty("性别")
    private String gender;
    //@ApiModelProperty("邮箱")
    private String email;
    //@ApiModelProperty("头像")
    private String avatar;
    //@ApiModelProperty("状态：1=已激活，2=已禁用，4=未激活，5=退出企业")
    private Integer status;
    private Integer enable;
    //@ApiModelProperty("是否是领导：1是0否")
    private Integer isleader;
    private Extra extattr;
    //@ApiModelProperty("隐藏号码")
    @Field("hide_mobile")
    private Integer hideMobile;

    //@ApiModelProperty("电话号码")
    private String telephone;

    private List<Integer> order;

    @Field("external_profile")
    private ExternalProfile externalProfile;

    //@ApiModelProperty("主部门Id")
    @Field("main_department")
    private Integer mainDepartment;
    //@ApiModelProperty("员工个人二维码")
    @Field("qr_code")
    private String qrCode;
    //@ApiModelProperty("别名")
    private String alias;
    //@ApiModelProperty("表示在所在的部门内是否为部门负责人")
    @Field("is_leader_in_dept")
    private List<Integer> isLeaderInDept;
    //@ApiModelProperty("地址")
    private String address;
    //@ApiModelProperty("小头像")
    @Field("thumb_avatar")
    private String thumbAvatar;
    //@ApiModelProperty("直属上级UserID")
    @Field("direct_leader")
    private List<String> directLeader;
    //@ApiModelProperty("企业邮箱")
    @Field("biz_mail")
    private String bizMail;
    //@ApiModelProperty("创建时间")
    @Field("create_time")
    private Date createTime;
    //@ApiModelProperty("更新时间")
    @Field("update_time")
    private Date updateTime;
    //@ApiModelProperty(value = "用户注册时填入的邀请码")
    @Field("invite_code")
    private String inviteCode;

    //@ApiModelProperty(value = "lookup字段")
    // private QxDepartment myDept;

    //@ApiModelProperty(value = "统计用，店铺下顾客数")
    private long memberCount = 0;

    //@ApiModelProperty("是否是高管：1是")
    @Field("is_high")
    private Integer isHigh;

    //@ApiModelProperty("离职人员余额汇总")
    @Field("money_left")
    private Integer moneyLeft;

    @Field("yunke_pid")
    private String yunkePid;
    @Field("yunke_id")
    private String yunkeId;

    @Field("wechat_accounts")
    private List<WechatAccount> wechatAccounts;

    //@ApiModelProperty("是否删除，1是")
    @Field("is_del")
    private Integer isDel;

    //@ApiModelProperty("企信openid")
    @Field("qx_openid")
    private String qxOpenid;

    @Data
    public static class Attr {

        private String name;
        private String value;
        private String type;
        private Map<String, String> text;
    }

    @Data
    public static class Extra {
        private List<Attr> attrs;
    }

    @Data
    public static class ExternalProfile {
        private List<Map> external_attr;
        private WechatChannels wechat_channels;
    }

    @Data
    public static class WechatChannels {
        private String nickname;
        private Integer status;
    }

    @Data
    public static class WechatAccount {
        //@ApiModelProperty("昵称")
        private String nickname;
        //@ApiModelProperty("微信头像")
        private String headUrl;
        //@ApiModelProperty("微信绑定的手机号")
        private String phone;
        //@ApiModelProperty("微信id")
        private String wechatId;
        //@ApiModelProperty("微信号")
        private String alias;
        //@ApiModelProperty("1是，其他不是，手动指定")
        @Field("is_current")
        private Integer isCurrent;
    }
}
